package cn.ffcs.uec.recordsApproval.vo;

import java.io.Serializable;
import java.util.Date;

import cn.ffcs.uec.recordsApproval.manager.AtiUserManager;
import cn.ffcs.uec.recordsApproval.model.AtiUser;
import cn.ffcs.uec.staff.manager.UecStaffInfoManager;
import cn.ffcs.uec.staff.model.UecStaffInfo;
import cn.ffcs.uom.common.util.ApplicationContextUtil;
import cn.ffcs.uom.common.util.StrUtil;
import lombok.Getter;
import lombok.Setter;

public class HistoricTaskVo implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2968791271279687116L;

	private String processInstanceId;

	private String processDefinitionId;

	private Date startTime;

	private Date endTime;

	private Long durationInMillis;

	/**
	 * taskDefName
	 */
	private String name;

	private String currentCandidate;

	private String assignee;

	private String procDefName;

	private String formSender;

	private Object formTheme;

	private Object formContent;

	private Long atiCategoryId;

	public String getProcessInstanceId() {
		return processInstanceId;
	}

	public void setProcessInstanceId(String processInstanceId) {
		this.processInstanceId = processInstanceId;
	}

	public String getProcessDefinitionId() {
		return processDefinitionId;
	}

	public void setProcessDefinitionId(String processDefinitionId) {
		this.processDefinitionId = processDefinitionId;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public Long getDurationInMillis() {
		return durationInMillis;
	}

	public void setDurationInMillis(Long durationInMillis) {
		this.durationInMillis = durationInMillis;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAssignee() {
		return assignee;
	}

	public void setAssignee(String assignee) {
		this.assignee = assignee;
	}

	public String getFormSender() {
		return formSender;
	}

	public void setFormSender(String formSender) {
		this.formSender = formSender;
	}

	public Object getFormTheme() {
		return formTheme;
	}

	public void setFormTheme(Object formTheme) {
		this.formTheme = formTheme;
	}

	public Object getFormContent() {
		return formContent;
	}

	public void setFormContent(Object formContent) {
		this.formContent = formContent;
	}

	public String getProcDefName() {
		return procDefName;
	}

	public void setProcDefName(String procDefName) {
		this.procDefName = procDefName;
	}

	public Long getAtiCategoryId() {
		return atiCategoryId;
	}

	public void setAtiCategoryId(Long atiCategoryId) {
		this.atiCategoryId = atiCategoryId;
	}

	public String getCurrentCandidate() {
		return currentCandidate;
	}

	public void setCurrentCandidate(String currentCandidate) {
		this.currentCandidate = currentCandidate;
	}

	public String getAssigneeName() {
		if (!StrUtil.isNullOrEmpty(assignee)) {
			AtiUserManager atiUserManager = (AtiUserManager) ApplicationContextUtil
					.getBean("atiUserManager");
			AtiUser atiUser = new AtiUser();
			atiUser.setNo(assignee);
			atiUser = atiUserManager.findAtiUserByAtiUser(atiUser);
			return atiUser.getName();
		}
		return assignee;
	}

	public String getCurrentCandidateName() {
		if (!StrUtil.isNullOrEmpty(this.currentCandidate)) {
			AtiUserManager atiUserManager = (AtiUserManager) ApplicationContextUtil
					.getBean("atiUserManager");
			AtiUser atiUser = new AtiUser();
			atiUser.setNo(currentCandidate);
			atiUser = atiUserManager.findAtiUserByAtiUser(atiUser);
			return atiUser.getName();
		}
		return currentCandidate;
	}

}
